package com.feicheng.lanniao.controller;


import java.time.LocalDateTime;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.feicheng.lanniao.entity.HouseBuyClientVo;
import com.feicheng.lanniao.result.ResultInfo;
import com.feicheng.lanniao.service.IHouseBuyClientVoService;
import com.feicheng.lanniao.service.IHouseBuyInfoService;

/**
 * <p>
 * VIEW 前端控制器
 * </p>
 *
 * @author feichengTech
 * @since 2021-09-07
 */
@RestController
@RequestMapping("/lanniao-admin/house-buy-client-vo")
public class HouseBuyClientVoController {

	@Autowired
	private IHouseBuyClientVoService iHouseBuyClientVoService;
	 
	/**
	 * 买房列表查询
	 * @param title 标题
	 * @param detail 详情
	 * @param clientId 客户id
	 * @param currentPage 当前页
	 * @param pageSize 每页多少条
	 * @return 返回买房列表集合
	 */
	@GetMapping("/page")
	public ResultInfo getList(
			String title, 
			String detail,
			Integer  clientId ,
			@RequestParam(defaultValue = "1")int currentPage,
			@RequestParam(defaultValue = "10")int pageSize
			
			) {
		Page<HouseBuyClientVo> page = iHouseBuyClientVoService.getlist(title,detail,clientId,currentPage, pageSize);
		return ResultInfo.success(page);
	}

	/**
	 * 买房详情查询
	 * @param houseBuyId 买房id
	 * @return 买房详情
	 */
	@GetMapping("/info")
	public ResultInfo getInfo(Integer houseBuyId) {
		System.out.println(houseBuyId);
		return iHouseBuyClientVoService.getInfo(houseBuyId);	
	}
}
